﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media.Imaging;

namespace FalionForm
{
    public partial class MainWindow : Window
    {


        Time time = new Time();
        private void Time_TimeDisp(string str)
        {
            StatueTime.Text = str;
        }//时间显示
        public void ChangePic(int i)//更改头像
        {
            string path = "/UserPicture/" + i.ToString() + ".png";
            image1.Source = new BitmapImage(new Uri(path, UriKind.Relative));
        }
        private void Window_KeyDown(object sender, KeyEventArgs e)//窗体缩放快捷键
        {
            if (e.Key == Key.Escape)
            {
                if (this.WindowState != WindowState.Maximized)
                {
                    this.WindowState = WindowState.Maximized;
                }
                else
                {
                    this.WindowState = WindowState.Normal;
                }
            }
        }
        private void ChanWinState(object sender, RoutedEventArgs e)//窗体缩放按钮
        {
            if (this.WindowState != WindowState.Maximized)
            {
                this.WindowState = WindowState.Maximized;
            }
            else
            {
                this.WindowState = WindowState.Normal;
            }
        }
        private void window_MouseMove(object sender, MouseEventArgs e)//移动窗体
        {


        }
        private void Grid_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                try
                {
                    this.DragMove();
                }
                catch
                {
                }

            }
        }
    }
}
